home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_objc.idb / usr / freeware / include / objpak / set.h.z / set.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  2.5 KB  |  124 lines

  1.  
  2. /*
  3.  * Portable Object Compiler (c) 1997,98.  All Rights Reserved.
  4.  * $Id: set.h,v 1.11 1999/06/23 19:22:13 stes Exp $
  5.  */
  6.  
  7. /*
  8.  * This library is free software; you can redistribute it and/or modify it
  9.  * under the terms of the GNU Library General Public License as published 
  10.  * by the Free Software Foundation; either version 2 of the License, or
  11.  * (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public License
  19.  * along with this program; if not, write to the Free Software
  20.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23. #ifndef __OBJSET_H__
  24. #define __OBJSET_H__
  25.  
  26. #include "cltn.h"
  27.  
  28. typedef struct objset {
  29.     int        count;
  30.     int        capacity;
  31.     id*        ptr;
  32. } *objset_t;
  33.  
  34. @interface Set : Cltn
  35. {
  36.     struct objset    value;
  37. }
  38.  
  39. + new;
  40. + new:(unsigned)n;
  41. + with:(int)nArgs,...;
  42. + with:firstObject with:nextObject;
  43. + add:firstObject;
  44. - copy;
  45. - deepCopy;
  46. - emptyYourself;
  47. - freeContents;
  48. - free;
  49.  
  50. - (unsigned) size;
  51. - (BOOL) isEmpty;
  52. - eachElement;
  53.  
  54. - (BOOL) isEqual:set;
  55.  
  56. - add:anObject;
  57. - addNTest:anObject;
  58. - filter:anObject;
  59. #if OBJC_BLOCKS
  60. - add:anObject ifDuplicate:aBlock;
  61. #endif /* OBJC_BLOCKS */
  62.  
  63. - replace:anObject;
  64.  
  65. - remove:oldObject;
  66. - remove:oldObject ifAbsent:exceptionBlock;
  67.  
  68. - (BOOL) includesAllOf:aCltn;
  69. - (BOOL) includesAnyOf:aCltn;
  70.  
  71. - addAll:aCltn;
  72. - addContentsOf:aCltn;
  73. - addContentsTo:aCltn;
  74. - removeAll:aCltn;
  75. - removeContentsFrom:aCltn;
  76. - removeContentsOf:aCltn;
  77.  
  78. - intersection:bag;
  79. - union:bag;
  80. - difference:bag;
  81.  
  82. - asSet;
  83. - asOrdCltn;
  84.  
  85. #if OBJC_BLOCKS
  86. - detect:aBlock;
  87. - detect:aBlock ifNone:noneBlock;
  88. - select:testBlock;
  89. - reject:testBlock;
  90. - collect:transformBlock;
  91. - (unsigned) count:aBlock;
  92. #endif /* OBJC_BLOCKS */
  93.  
  94.  
  95. - elementsPerform:(SEL)aSelector;
  96. - elementsPerform:(SEL)aSelector with:anObject;
  97. - elementsPerform:(SEL)aSelector with:anObject with:otherObject;
  98. - elementsPerform:(SEL)aSelector with:anObject with:otherObject with:thirdObj;
  99.  
  100. #if OBJC_BLOCKS
  101. - do:aBlock;
  102. - do:aBlock until:(BOOL*)flag;
  103. #endif /* OBJC_BLOCKS */
  104.  
  105.  
  106. - find:anObject;
  107. - (BOOL) contains:anObject;
  108. - (BOOL) includes:anObject;
  109. - (unsigned) occurrencesOf:anObject;
  110.  
  111. - printOn:(IOD)aFile;
  112.  
  113. #ifdef __PORTABLE_OBJC__
  114. - fileOutOn:aFiler;
  115. - fileInFrom:aFiler;
  116. - awakeFrom:aFiler;
  117. #endif /* __PORTABLE_OBJC__ */
  118.  
  119. @end
  120.  
  121. #endif /* __OBJSET_H__ */
  122.  
  123.  
  124.